package course14;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;

public class Array {
    public static void main(String[] args) {
        ArrayList List=new ArrayList();
        List.add("张三");
        List.add("李四");
        List.add("王五");
        System.out.println("List数组的元素个数是："+List.size());
        System.out.println(List);
        //遍历数组1
      /* Iterator iter=List.iterator();
       while (iter.hasNext()){
           String name=(String)iter.next();
           System.out.println(name);
       }*/
       //遍历方法2
       for (int i=0;i<List.size();i++){
           System.out.println(List.get(i));
       }
    }
}
